package day07;

import java.util.Random;

//要求生成4位验证码（大小写字母、数字）
public class VerificationCode {
    public static void main(String[] args) {
        String  code=about(4);
        System.out.println("验证码为："+code);
    }
    public static String about(int len){
        String aa="";
        char[]chs={'1','2','3','4','5','6','7','8','9',
                    'a','b','c','d','e','f','g','h','i','j',
                    'k','姜','志','可','以'};
        Random rand=new Random();
        for(int i=1;i<=len;i++){
            //int index=(int)(Math.random()*25);
        int index=rand.nextInt(chs.length);
            aa+=chs[index];
        }
        return  aa;
    }
}
